/**
 * this class is used as API
 * auther marvell
 * modify by libaocheng 
 */
package com.hisense.settings.util;

import static android.provider.Settings.System.SOUND_EFFECTS_ENABLED;
import com.google.android.tv.model.Channel;

import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.HashMap;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;

import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.media.AudioManager;
import android.media.RingtoneManager;
import android.os.Bundle;
import android.os.SystemClock;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import com.android.settings.R;
import com.hisense.settings.MyLog;
import com.hisense.settings.device.PairingDevice;

/*import com.marvell.hdmicec.CecManager;
import com.marvell.hdmicec.ITvCecService;
import com.marvell.tv.TVAVSettingsConstants;
import com.marvell.tv.TVAVSettingsConstants.TvAudioProperty;
import com.marvell.tv.TVAVSettingsConstants.TvPictureProperty;
import com.marvell.tv.TVAVSettingsConstants.TvPictureResetMode;
import com.marvell.tv.TVAVSettingsConstants.TvSource;
import com.marvell.tv.TVAVSettingsConstants.TvSourceType;
import com.marvell.willowtv.framework.features.Caption;
import com.marvell.willowtv.framework.features.TvFramework;
import com.marvell.willowtv.framework.features.LiveTv;
import com.marvell.willowtv.framework.features.TvDatabase;
import com.marvell.willowtv.framework.features.TvFramework;
import com.marvell.willowtv.framework.model.atsc.USDTVCanRating;
import com.marvell.willowtv.framework.model.atsc.USDTVPCData;
import com.marvell.willowtv.framework.model.atsc.USDTVServiceData;
import com.marvell.willowtv.framework.model.atsc.USDTVUSRating;
import com.marvell.willowtv.framework.model.avsettings.VideoInfoUpdate;
import com.marvell.willowtv.framework.util.atsc.AtscAudioEnums.AudioLanguage;
import com.marvell.willowtv.framework.util.atsc.AtscAudioEnums.MTS;
import com.marvell.willowtv.framework.util.atsc.ChannelEnumClass;
import com.marvell.willowtv.framework.util.atsc.ChannelEnumClass.ChannelDetails;
import com.marvell.willowtv.framework.util.atsc.ChannelEnumClass.ChannelType;
import com.marvell.willowtv.framework.util.atsc.ClosedCaptionEnumClass.CCAnalogDigitalServiceType;
import com.marvell.willowtv.framework.util.atsc.ClosedCaptionEnumClass.CCDisplayMode;
import com.marvell.willowtv.framework.util.atsc.ClosedCaptionEnumClass.CloseCaptionPropEnums;
import com.marvell.willowtv.framework.util.atsc.InputSourceType;
import com.marvell.willowtv.framework.util.atsc.PCEnumClass.PCCanadaEnglishRatings;
import com.marvell.willowtv.framework.util.atsc.PCEnumClass.PCCanadaFrenchRating;
import com.marvell.willowtv.framework.util.atsc.PCEnumClass.PCDimensionRating;
import com.marvell.willowtv.framework.util.atsc.PCEnumClass.PCPresetModes;
import com.marvell.willowtv.framework.util.atsc.PCEnumClass.PCUSMovieRatings;
import com.marvell.willowtv.framework.util.atsc.PCEnumClass.PCUSUnratedGroups;
import com.marvell.willowtv.framework.util.atsc.SetupEnumClass.PowerOnOffTimer;
import com.marvell.willowtv.framework.util.atsc.USDTVMessageQueue;*/

public class Wrapper {
	private static final String TAG = "Wrapper";
	private static Wrapper mWrapperInstance = null;
	//private TvFramework mTvFramework = null;
	//private final TvDatabase mTvDatabase = TvFramework.getInstance().getTvDatabaseInstance();
	private static Context mContext = null;
    private final SharedPreferences mCecPrefs = null;
	public final static int ONE_MINUTE = 60 * 1000;
	/*private static int PICTURE_MODE_USER = TVAVSettingsConstants.TvPictureMode.TV_PICTURE_ModeCustom
			.value();
	private static int AUDIO_MODE_USER = TVAVSettingsConstants.TvAudioMode.TV_AUDIO_ModeUser
			.value();
	private ITvCecService mITvCecService = null;*/
	private AudioManager mAudioManager;
	public static final String KEY_HDMICEC_CONTROL_FOR_HDMI = "settings_hdmicec_control_forHdmi";
	public static final String KEY_HDMICEC_DEVICE_AUTO_POWEROFF = "settings_hdmicec_device_auto_poweroff";
	public static final String KEY_HDMICEC_TV_AUTO_POWEROn = "settings_hdmicec_device_auto_poweron";
	public static final String KEY_HDMICEC_SYSTEM_AUDIO_CTRL = "settings_hdmicec_system_audio_control";
	public static final int PARAM_ENABLE = 1;
	public static final int PARAM_DISABLE = 0;

	public static final String KEY_DLNA_STATE_ON_OFF = "dlna_state_on_off";
	public static final String KEY_DLNA_STATE_ON_OFF_REAL = "dlna_state_on_off_real";

	static final public String ACTION_UPDATE_QSB = "com.hisense.gtv.action.UPDATE_QSB";

	private Thread mThread = null;
	private long CecSettingMillis = -1;
	private long sacSettingMillis = -1;
	//private static CecManager mCecManager = null;
    //v4 add
	private static final int CHANNEL_UPDOWN_INTERVAL = 500;
    private static final int CHANNEL_UPDOWN_MESSAGEID = 999;

    private static final int CHANNEL_UP_TYPE = 0;
    private static final int CHANNEL_DOWN_TYPE = 1;
    private static final int CHANNEL_RECALL_TYPE = 2;
	private static Handler mHandler = new Handler(Looper.getMainLooper()) {

        @Override
        public void handleMessage(Message msg) {
            if (msg != null && msg.what == CHANNEL_UPDOWN_MESSAGEID) {
                Log.d(TAG, "allow channel operation");
            }
        }
    };
	/********************************* Common begin ************************************/
	public static Wrapper getWrapperInstance() {
		if (mWrapperInstance == null) {
			mWrapperInstance = new Wrapper();
			//mWrapperInstance.mTvFramework = TvFramework.getInstance();
			//mWrapperInstance.mTvFramework.isCCInit(); // init CC as early as
														// possible
		}
		return mWrapperInstance;
	}

	public Context getContext() {
		return mContext;
	}

	public void setContext(Context context) {
		if (mContext == null) {
			mContext = context;
			mAudioManager = (AudioManager) mContext
					.getSystemService(Context.AUDIO_SERVICE);
			//mCecManager = new CecManager(context);
		}
	}

	// add for CEC devicelist
	/*public CecManager getCecManager() {
		return mCecManager;
	}*/

	public int getCurrentSource() {
		/* int inputSrcId = TvFramework.getInstance().getLiveTvInstance()
				.getCurrentSource();
		return inputSrcId; */
		return 0;
	}
	public int getCurrentSourceType() {
		/* int inputSrcId = TvFramework.getInstance().getLiveTvInstance()
				.getCurrentSource();
				Log.d(TAG, "getSourceType(inputSrcId) = "+ TvFramework.getInstance().getLiveTvInstance()
				.getSourceType(inputSrcId));
		return TvFramework.getInstance().getLiveTvInstance()
				.getSourceType(inputSrcId); */
		return 0;
	}

	/*-----------------------------------------------------------------*/

	/********************************* Common end ************************************/

    /********************************* picture ************************************/
    /********************************* Advanced Settings begin *****************************/
    public int getSmoothMotionEffect() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_FrcMode); */
		return 0;
    }

    public void setSmoothMotionEffect(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_FrcMode, value); */
    }

    public int getSmoothness() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_FrcLevel); */
		return 0;
    }

    public void setSmoothness(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_FrcLevel, value); */
    }

    public int getOverscan() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Overscan); */
		return 0;
    }

    public void setOverscan(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Overscan, value); */
    }

	/********************************* NoiseReduction begin ************************************/
	public int getNoiseReduction() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_NoiseReduction); */
		return 0;
    }

    public void setNoiseReduction(int value) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_NoiseReduction, value); */
    }

    public int getTemporalNR() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_VNR); */
		return 0;
    }

    public void setTemporalNR(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_VNR, value); */
    }

    public int getMosquitoNR() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_MNR); */
		return 0;
    }

    public void setMosquitoNR(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_MNR, value); */
    }

    public int getBlockArtifactReduction() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_BNR); */
		return 0;
    }

    public void setBlockArtifactReduction(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_BNR, value); */
    }

	/********************************* NoiseReduction end ************************************/

    public int getGammaMode() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Gamma); */
		return 0;
    }

    public void setGammaMode(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Gamma, value); */
    }

    public int getSkinTuneCorrection() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_FreshTone); */
		return 0;
    }

    public void setSkinTuneCorrection(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_FreshTone, value); */
    }

    /********************************* SizeAndPosition begin ************************************/
    public int getHorizontalPosition() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_HorPosition); */
		return 0;
    }

    public void setHorizontalPosition(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_HorPosition, value); */
    }

    public int getVerticalPosition() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_VerPosition); */
				return 0;
    }

    public void setVerticalPosition(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_VerPosition, value); */
    }

    public int getHorizontalSize() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_HorSize); */
				return 0;
    }

    public void setHorizontalSize(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_HorSize, value); */
    }

    public int getVerticalSize() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_VerSize); */
				return 0;
    }

    public void setVerticalSize(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_VerSize, value); */
    }

    public int getPhase() {
        // return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                // TvPictureProperty.TV_PICTURE_Phase);
				return 0;
    }

    public void setPhase(int value) {
        // mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                // TvPictureProperty.TV_PICTURE_Phase, value);
    }

    public int getClock() {
        // return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                // TvPictureProperty.TV_PICTURE_Clock);
				return 0;
    }

    public void setClock(int value) {
        // mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                // TvPictureProperty.TV_PICTURE_Clock,
                // value);
    }

    /* public static HashMap<String, TvPictureProperty> mPicturePropertyMapping;

    static {
        mPicturePropertyMapping = new HashMap<String, TvPictureProperty>();
        mPicturePropertyMapping.put("HorizontalPosition",
                TvPictureProperty.TV_PICTURE_HorPositionRange);
        mPicturePropertyMapping.put("VerticalPosition",
                TvPictureProperty.TV_PICTURE_VerPositionRange);
        mPicturePropertyMapping.put("HorizontalSize", TvPictureProperty.TV_PICTURE_HorSizeRange);
        mPicturePropertyMapping.put("VerticalSize", TvPictureProperty.TV_PICTURE_VerSizeRange);
        mPicturePropertyMapping.put("Phase", TvPictureProperty.TV_PICTURE_PhaseRange);
        mPicturePropertyMapping.put("Clock", TvPictureProperty.TV_PICTURE_ClockRange);
    } */

    public Bundle getPropertyRange(String api_Name) {
        /* TvPictureProperty videoProp;
        videoProp = mPicturePropertyMapping.get(api_Name);
        int max = 0, min = 0;
        Bundle bundle = null;
        if (videoProp != null) {
            int range = TvFramework.getInstance().getPictureInstance()
                    .getVideoProperty(getCurrentSource(), videoProp);
            max = range & 0xffff;
            min = (short) (range >>> 16); // unsigned shift
            Log.d(TAG, "getPropertyRange range=" + range + ", max=" + max + ", min=" + min);

            bundle = new Bundle();
            bundle.putInt("max", max);
            bundle.putInt("min", min);
        }
        return bundle; */
		return null;
    }

    public int getAutoAdjust() {
       /*  return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_AutoAjust); */
				return 0;
    }

    public void setAutoAdjust(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_AutoAjust,
                value); */
    }

	/********************************* SizeAndPosition end ************************************/

	/********************************* WhiteBalance begin ************************************/
	public int getRedGain() {
		return 0;
	}

	public void setRedGain(int value) {

	}

	public int getGreenGain() {
		return 0;
	}

	public void setGreenGain(int value) {
		
	}

	public int getBlueGain() {
		return 0;
	}

	public void setBlueGain(int value) {
		
	}

	public int getRedOffset() {
		return 0;
	}

	public void setRedOffset(int value) {
		
	}

	public int getGreenOffset() {
		return 0;
	}

	public void setGreenOffset(int value) {
		
	}

	public int getBlueOffset() {
		return 0;
	}

	public void setBlueOffset(int value) {
		
	}

	/********************************* WhiteBalance end ************************************/

    public int getDynamicContrast() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_ACE); */
				return 0;
    }

	public void setDynamicContrast(int value) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_ACE, value); */
    }

	/********************************* ColorMasking begin ************************************/
	public int getRedColorMasking() {
		return 0;
	}

	public void setRedColorMasking(int value) {
	
	}

	public int getGreenColorMasking() {
		return 0;
	}

	public void setGreenColorMasking(int value) {
	
	}

	public int getBlueColorMasking() {
		return 0;
	}

	public void setBlueColorMasking(int value) {
		
	}

	public void resetPictureMode() {
        /* mTvFramework.getPictureInstance().setVideoProperty(
                getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Reset,
                TvPictureResetMode.TV_PICTURE_RESET_Basic.value()); */
    }

    public void resetAdvancedPictureMode() {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Reset,
                TvPictureResetMode.TV_PICTURE_RESET_User.value()); */
    }

    /********************************* Advanced Settings end ************************************/
    public int getScreenMode() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_ScreenMode); */
				return 0;
    }

    public void setScreenMode(int val) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_ScreenMode,
                val); */
    }

    /********************************* Basic Picture begin ************************************/
    public int getPictureMode() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_PictureMode); */
				return 0;
    }

	public void setPictureMode(int pictureMode) {
		 /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
		 TvPictureProperty.TV_PICTURE_PictureMode,
		 pictureMode); */
	}

	public void setAllSourcePictureMode(int pictureMode) {
		/* setPictureMode(pictureMode);
		Log.d(TAG, "setAllSourcePictureMode -->>" + pictureMode);
		mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
				TvPictureProperty.TV_PICTURE_Reset,5); */
	}

    private boolean switchPicUserMode() {
	/* Log.d(TAG, "getPictureMode -->>" + getPictureMode());
	Log.d(TAG, "PICTURE_MODE_USER -->>" + PICTURE_MODE_USER);
        if (getPictureMode() != PICTURE_MODE_USER) {
            int backLight = getBackLight();
            int brightNess = getBrightNess();
            int contrast = getContrast();
            int color = getColor();
            int tint = getTint();
            int sharpness = getSharpness();
            int colorTemperature = getColorTemperature();
            int lightSensor = getSmartDimming();
            int dynamicContrast = getDynamicContrast();
            int noiseReduction = getNoiseReduction();
            setPictureMode(PICTURE_MODE_USER);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_Backlight,
                    backLight);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_Brightness,
                    brightNess);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_Contrast,
                    contrast);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_Saturation,
                    color);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_Hue,
                    tint);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_Sharpness,
                    sharpness);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_ColorTemperature,
                    colorTemperature);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_SmartDimming,
                    lightSensor);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_ACE,
                    dynamicContrast);
            mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                    TvPictureProperty.TV_PICTURE_NoiseReduction,
                    noiseReduction);
            return true;
        } */
        return false;
    }

    public int getBackLight() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Backlight); */
				return 0;
    }

    public void setBackLight(int backLight) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Backlight,
                backLight); */
    }

    public int getBrightNess() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Brightness); */
				return 0;
    }

    public void setBrightNess(int brightNess) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Brightness,
                brightNess); */
    }

    public int getContrast() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Contrast); */
				return 0;
    }

    public void setContrast(int contrast) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Contrast,
                contrast); */
    }

    public int getColor() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Saturation); */
				return 0;
    }

    public void setColor(int color) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Saturation,
                color); */
    }

    public int getTint() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Hue); */
				return 0;
    }

    public void setTint(int tint) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Hue,
                tint); */
    }

    public int getSharpness() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Sharpness); */
				return 0;
    }

    public void setSharpness(int sharpness) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Sharpness,
                sharpness); */
    }

    public int getColorTemperature() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_ColorTemperature); */
				return 0;
    }

    public void setColorTemperature(int colorTemperature) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_ColorTemperature, colorTemperature); */
    }

    /********************************* Basic Picture end ************************************/
    public int getSmartDimming() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_SmartDimming); */
				return 0;
    }

    public void setSmartDimming(int smartDimming) {
		/* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_SmartDimming,
                smartDimming); */
    }

    public int getLightSensor() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TY_PICTURE_LightSensor); */
				return 0;
    }

    public void setLightSensor(int val) {
        /* switchPicUserMode();
        mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TY_PICTURE_LightSensor,
                val); */
    }

	/********************************* Picture end ************************************/

	/********************************* PIPAudio ************************************/

	public int getPIPAudio() {
		return 0;
	}

	public void setPIPAudio(int value) {
		
	}

	/********************************* Audio begin ************************************/
	public int getAutoDetail() {
		return 0;
	}

	public void setAutoDetail(int value) {
      
	}

    public int getSRSTruVolume() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_SRS_TruVolume); */
				return 0;
    }

    public void setSRSTruVolume(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_SRS_TruVolume, value); */
    }

    public int getSRSStudioSoundHD() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_SRS_StudioSoundHD); */
				return 0;
    }

    public void setSRSStudioSoundHD(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_SRS_StudioSoundHD, value); */
    }

    public int getEQMode() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_EQMode); */
				return 0;
    }

    public void setEQMode(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_EQMode, value); */
    }

    public int getTreble() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Treble); */
				return 0;
    }

    public void setTreble(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Treble, value); */
    }

    public int getBass() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Bass); */
				return 0;
    }

    public void setBass(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Bass, value); */
    }

    public int getAudioMode() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_AudioMode); */
				return 0;
    }

    public void setAudioMode(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_AudioMode, value); */
    }

	public boolean isAudioUserMode() {
		/* if (getAudioMode() == AUDIO_MODE_USER) {
			return true;
		} else {
			return false;
		} */
		return false;
	}

	private boolean switchAudioUserMode() {
        /* if (getAudioMode() != AUDIO_MODE_USER) {
            int band1 = getBand1();
            int band2 = getBand2();
            int band3 = getBand3();
            int band4 = getBand4();
            int band5 = getBand5();
            setAudioMode(AUDIO_MODE_USER);
            mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                    TvAudioProperty.TV_AUDIO_Band0, band1);
            mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                    TvAudioProperty.TV_AUDIO_Band1, band2);
            mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                    TvAudioProperty.TV_AUDIO_Band2, band3);
            mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                    TvAudioProperty.TV_AUDIO_Band3, band4);
            mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                    TvAudioProperty.TV_AUDIO_Band4, band5);
            return true;
        } */
        return false;
    }

    public int getBand1() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band0); */
				return 0;
    }

    public void setBand1(int value) {
        /* switchAudioUserMode();
        mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band0, value); */
    }

    public int getBand2() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band1); */
				return 0;
    }

    public void setBand2(int value) {
        /* switchAudioUserMode();
        mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band1, value); */
    }

    public int getBand3() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band2); */
				return 0;
    }

    public void setBand3(int value) {
        /* switchAudioUserMode();
        mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band2, value); */
    }

    public int getBand4() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band3); */
				return 0;
    }

    public void setBand4(int value) {
        /* switchAudioUserMode();
        mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band3, value); */
    }

    public int getBand5() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band4); */
				return 0;
    }

    public void setBand5(int value) {
        /* switchAudioUserMode();
        mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Band4, value); */
    }

    public int getBalance() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Balance) / 5; */
				return 0;
    }

    public void setBalance(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Balance, value * 5); */
    }

    public int getLipSync() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Lipsync); */
				return 0;
    }

    public void setLipSync(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_Lipsync, value); */
    }

    public int getBaseBoost() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_BassVolume); */
				return 0;
    }

    public void setBaseBoost(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_BassVolume, value); */
    }

    public int getDRCMode() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_DrcMode); */
				return 0;
    }

    public void setDRCMode(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_DrcMode, value); */
    }

    public int getTVSpeakers() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_OUT_TvSpeaker); */
				return 0;
    }

    public void setTVSpeakers(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_OUT_TvSpeaker, value); */
    }

    public int getVolumeControl() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_OUT_VolumeControl); */
				return 0;
    }

    public void setVolumeControl(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_OUT_VolumeControl, value); */
    }

    public int getAnalogAudioOut() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_OUT_AnalogOut); */
				return 0;
    }

    public void setAnalogAudioOut(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_OUT_AnalogOut, value); */
    }

    public int getDigitalAudioOut() {
        /* return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_OUT_DigitalOut); */
				return 0;
    }

    public void setDigitalAudioOut(int value) {
        /* mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                TvAudioProperty.TV_AUDIO_OUT_DigitalOut, value); */
    }

	public int getMTS() {
		//return mTvFramework.getAudioInstance().GetPreferredAnalogMTSMode().ordinal();
		return 0;
	}

    int mPrefMTS;
    Runnable mPrefMTSRunnable = null;

    public void setMTS(int value) {
        // mPrefMTS = value;
        // if (mPrefMTSRunnable == null) {
            // mPrefMTSRunnable = new Runnable() {

                // @Override
                // public void run() {
                    // updatePrefMTS(mPrefMTS);
                // }
            // };
        // }
        // runInNonUiThread(mPrefMTSRunnable, 500);
    }

    public void updatePrefMTS(int value) {
        //mTvFramework.getAudioInstance().setPreferredAnalogMTSMode(MTS.values()[value]);
    }
    
    public void setMTSForReset(int value) {
        //mTvFramework.getAudioInstance().setPreferredAnalogMTSMode(MTS.values()[value]);
    }


	public int getAudioService() {
		//return mTvFramework.getAudioInstance().getPreferredAudioLanguage().ordinal();
		return 0;
	}

	public void setAudioService(int audioService) {
		// mTvFramework.getAudioInstance().setPreferredAudioLanguage(
                // AudioLanguage.values()[audioService]);
	}

	public void resetAudioMode(int value) {
       /*  mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(), TvAudioProperty.TV_AUDIO_Reset, value);
        //default on
        setSoundeffects(1);
        //default Stereo
        setMTSForReset(1);
        //default English
        setAudioService(0);
        //default volume of settings
        AudioManager mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
        //4-->volume=30
        mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 30, 0);
		 //default notification sound
		 RingtoneManager.setActualDefaultRingtoneUri(mContext,RingtoneManager.TYPE_NOTIFICATION, null);
		 
		 //default AVsync-->3
		 setLipSync(3); */
	}

	public int getSoundeffects() {
		 // return Settings.System.getInt(mContext.getContentResolver(),
		 // SOUND_EFFECTS_ENABLED, FALLBACK_SOUND_EFFECTS_VALUE);
		 return 0;
	}

	private static final int FALLBACK_SOUND_EFFECTS_VALUE = 0; // Disabled.

	public void setSoundeffects(int soundeffects) {
		 /* AudioManager am =
		 (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
		 if (soundeffects == 1) {
		 am.loadSoundEffects();
		 } else {
		 am.unloadSoundEffects();
		 }
		 Settings.System.putInt(mContext.getContentResolver(),
		 SOUND_EFFECTS_ENABLED, soundeffects == 1 ? 1 : 0); */
	}

	public int getSoundOptimized() {
		// return mTvFramework.getAudioInstance().getAudioProperty(getCurrentSource(),
                // TvAudioProperty.TV_AUDIO_SoundOptimize);
				return 0;
	}

	public void setSoundOptimized(int value) {
		// mTvFramework.getAudioInstance().setAudioProperty(getCurrentSource(),
                // TvAudioProperty.TV_AUDIO_SoundOptimize, value);
	}

	/********************************* Volume begin ************************************/
	public int getSystemVolume() {
		return 0;
	}

	public void setSystemVolume(int volume) {
		
	}

	public int getWarning() {
		/*
		 * boolean muted =
		 * mAudioManager.isStreamMute(AudioManager.STREAM_MUSIC); final int
		 * volume = muted ? mAudioManager
		 * .getLastAudibleStreamVolume(AudioManager.STREAM_MUSIC) :
		 * mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC); return
		 * volume;
		 */
		return 0;
	}

	public void setWarning(int volume) {
		// mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, volume, 0);
	}

	public int getAlarm() {
		/*
		 * boolean muted =
		 * mAudioManager.isStreamMute(AudioManager.STREAM_ALARM); final int
		 * volume = muted ? mAudioManager
		 * .getLastAudibleStreamVolume(AudioManager.STREAM_ALARM) :
		 * mAudioManager.getStreamVolume(AudioManager.STREAM_ALARM); return
		 * volume;
		 */
		return 0;
	}

	public void setAlarm(int volume) {
		// mAudioManager.setStreamVolume(AudioManager.STREAM_ALARM, volume, 0);
	}

	/********************************* Volume end ************************************/
	/********************************* Audio end ************************************/

	/*-----------------------------------------------------------------*/

	/********************************* Channel begin ************************************/
	public int getTunerMode() {
		 /* InputSourceType inputSourceType =
		 mTvFramework.getTunerInstance().getTunerMode(mContext);
		 if (inputSourceType == InputSourceType.ATSC_INPUT) {
		 return 0;
		 } else {
		 return 1;
		 } */
		 return 0;
	}

	public void setTunerMode(int val) {
        /* InputSourceType inputSourceType = InputSourceType.ATSC_INPUT;
        if (val == 1) {
            inputSourceType = InputSourceType.CABLE_INPUT;
        }
        // Setting the Closed caption to Off to avoid residue on the screen
        pauseCC();
        mTvFramework.getTunerInstance().setTunerMode(inputSourceType, mContext);

        updateChanneListToGTVDb(2000); */
		
    }

    public void updateChanneListToGTVDb(int delay) {
        // send intent to ask Controller to update GTV channel database
        /* Intent intent = new Intent(TvIntents.ACTION_UPDATE_CHANNELDB);
        intent.putExtra(TvIntents.EXTRA_DELAY, delay);
        mContext.sendBroadcast(intent); */
    }

    private final String KEY_CHANNEL_SURFING_MODE = "channelSurfingMode";

    public void setChannelSurfingMode(int value) {
        /* if (mTvDatabase.getIntValue(mContext, KEY_CHANNEL_SURFING_MODE, 1) != value) {
            mTvDatabase.setIntValue(mContext, KEY_CHANNEL_SURFING_MODE, value);
        } */
    }

    public int getChannelSurfingMode() {
        //return mTvDatabase.getIntValue(mContext, KEY_CHANNEL_SURFING_MODE, 1);
		return 0;
    }

    /*public boolean isSameChannel(ChannelDetails ch1, ChannelDetails ch2) {
         if (ch1 != null && ch2 != null) {
            boolean sameName = !TextUtils.isEmpty(ch1.getChannelName())
                    && ch1.getChannelName().equals(ch2.getChannelName());
            boolean sameNumber = (ch1.getMajorNo() == ch2.getMajorNo() && ch1.getMinorNo() == ch2
                    .getMinorNo());
            boolean sameServiceId = (ch1.getServiceId() != null && ch2.getServiceId() != null
                    && ch1.getServiceId().getServiceRec() == ch2.getServiceId().getServiceRec());
            if ((sameName || sameNumber) && sameServiceId)
                return true;
        } 
        return false;
    }

	public boolean isSameChannel(ChannelDetails ch1, Channel ch2) {
         if (ch1 != null && ch2 != null) {
            boolean sameName = !TextUtils.isEmpty(ch1.getChannelName())
                    && ch1.getChannelName().equals(ch2.getName());
            boolean sameNumber = (ch1.getMajorNo() == ch2.getChannelNumber().getMajor()
                    && ch1.getMinorNo() == ch2.getChannelNumber().getMinor());
            if (sameName || sameNumber)
                return true;
        } 
        return false;

    }
    public boolean allowChannelUpDown(List<ChannelDetails> enabledChannelList) {
         List<ChannelDetails> enabledChList = enabledChannelList;
        if (enabledChList == null) {
            enabledChList = mTvFramework.getLiveTvInstance().getEnabledChannelList();
        }
        int size = (enabledChList != null) ? enabledChList.size() : 0;
        if (size > 1) {
            return true;
        } else if (size == 1) {
            ChannelDetails currChannelDetails = mTvFramework.getLiveTvInstance()
                    .getCurrentChannelDetail();
            ChannelDetails chDetail = enabledChList.get(0);
            // If the current channel is the only enabled channel, don't allow
            // ch up/dn
            if (isSameChannel(chDetail, currChannelDetails))
                return false;
            else
                return true;
        } 

        return false;
    }*/

    private void doChannelOperation(final Context context, int type) {
        /* Log.d(TAG, "doChannelOperation type= " + type);
        boolean channelSurfingMode = (Wrapper.getWrapperInstance().getChannelSurfingMode() != 0);
        if (!channelSurfingMode || !mHandler.hasMessages(CHANNEL_UPDOWN_MESSAGEID)) {
            // To Remove lock screen
            //PCUtility.removeChannelLockScreen(context);

            if (channelSurfingMode)
                mHandler.sendMessageDelayed(mHandler.obtainMessage(CHANNEL_UPDOWN_MESSAGEID),
                        CHANNEL_UPDOWN_INTERVAL);

            switch (type) {
                case CHANNEL_UP_TYPE:
                    TvFramework.getInstance().getLiveTvInstance().channelUp();
                    break;
                case CHANNEL_DOWN_TYPE:
                    TvFramework.getInstance().getLiveTvInstance().channelDown();
                    break;
                case CHANNEL_RECALL_TYPE:
                    TvFramework.getInstance().getLiveTvInstance().recallLastChannel();
                    break;
            }
        } */
    }

    /**
     * To perform Channel Up
     * @param context
     *            application context
     */
    public void doChannelUp(final Context context) {
        Log.d(TAG, "doChannelUp() ");
        //doChannelOperation(context, CHANNEL_UP_TYPE);
    }

    /**
     * To perform Channel Down
     * @param context
     *            application context
     */
    public void doChannelDown(final Context context) {
        Log.d(TAG, "doChannelDown() ");
        //doChannelOperation(context, CHANNEL_DOWN_TYPE);
    }

    /**
     * To perform Channel recall
     * @param context
     *            application context
     */
    public void doChannelRecall(final Context context) {
        Log.d(TAG, "doChannelRecall() ");
        //doChannelOperation(context, CHANNEL_RECALL_TYPE);
    }

    public void resetChannelSettings() {
        // mTvFramework.getLiveTvInstance().resetChannelList();
        // setTunerMode(0);
    }

    /********************************* manualscan begin ************************************/
    private int ChannelNumber;
    private int Frequency;
    private int ModulationType;

	public int getChannelNumber() {
		return ChannelNumber;
	}

	public void setChannelNumber(int channelNumber) {
		ChannelNumber = channelNumber;
	}

	public int getFrequency() {
		return Frequency;
	}

	public void setFrequency(int frequency) {
		Frequency = frequency;
	}

	public int getModulationType() {
		return ModulationType;
	}

	public void setModulationType(int modulationType) {
		ModulationType = modulationType;
	}

	/********************************* manualscan end ************************************/
	/********************************* channel end ************************************/
	/********************************* Setup begin ************************************/

	

	/******************************* closedcaption begin *********************************/

	/**
	 * CC utility method to set the CC OFF temporarily, for the current channel
	 * on performing Channel Up / Channel down /Channel Change
	 */
	public void pauseCC() {
		Log.d(TAG, "pauseCC");
		// CC Off is performed only if CC Init is done
		// This is to avoid unnecessary platform calls, when CC is not in use
        /* if (mTvFramework.isCCInit() && getCCStatus()) {
            mTvFramework.getCaptionInstance().setCCStatus(false);
        } */
    }

    /**
     * CC utility method to resume the CC ON for the current channel on
     * performing Channel Up / Channel down /Channel Change
     */
    public void resumeCC() {
        Log.d(TAG, "resumeCC");
        // CC ON is performed only if CC Init is done
        // This is to avoid unnecessary platform calls, when CC is not in use
        /* if (mTvFramework.isCCInit() && getCCStatus()) {
            mTvFramework.getCaptionInstance().setCCStatus(true);
        } */
    }

	public int getClosedCaptions() {
		 /* if(null==mTvFramework.getCaptionInstance())
		 {
		 return 0;
		 }
        CCDisplayMode mode = mTvFramework.getCaptionInstance().getCCMode();
        // Log.d(TAG,"getCloseCaption mode ="+ mode);
        return mode.ordinal(); */
		return 0;
    }

	public void setClosedCaptions(int closedCaptions) {
		/* Caption cc = TvFramework.getInstance().getCaptionInstance();
        cc.setCCMode(CCDisplayMode.values()[closedCaptions]);
        if (closedCaptions != CCDisplayMode.CC_DISPLAY_OFF.ordinal()) {
            // If set cc to on and analogcc/digital cc is off or invalid, set
            // them to default cc1/cs1
            int analogcc = cc.GetCaptionData(
                    CloseCaptionPropEnums.EAnalogCC);
            int digitalcc = cc.GetCaptionData(
                    CloseCaptionPropEnums.EDigitalCC);
            if (analogcc == CCAnalogDigitalServiceType.OFF.ordinal()
                    || analogcc > CCAnalogDigitalServiceType.TXT4.ordinal()) {
                setAnalogCC(CCAnalogDigitalServiceType.CC1.ordinal());
            }
            if (digitalcc == CCAnalogDigitalServiceType.OFF.ordinal()
                    || (digitalcc >= CCAnalogDigitalServiceType.TXT1.ordinal()
                    && digitalcc <= CCAnalogDigitalServiceType.TXT4.ordinal())) {
                setDigitalCC(CCAnalogDigitalServiceType.CS1.ordinal());
            }

            if (closedCaptions == CCDisplayMode.CC_DISPLAY_ON_WHEN_MUTE.ordinal()) {
                boolean mute = HisUtils.isSystemMute(mContext);
                cc.setCCStatus(mute);
            }
        } */
	}
    //marvell doesn't have this method add by hisense.
	public void setClosedCaptionsForMute(int closedCaptions, Context mContext) {

		 /* if(mTvFramework.getCaptionInstance()== null)
		 {
		 Log.d(TAG,"---------999999999--");
		 return;
		 }
		
		 mTvFramework.getCaptionInstance().setCCMode(CCDisplayMode.values()[closedCaptions]);
		
		 Log.d(TAG,"--------00000000--");

		 if (closedCaptions != 0) {
		 // If set cc to on and analogcc/digital cc is off or invalid, set
		 // them to default cc1/cs1
		 int analogcc = mTvFramework.getCaptionInstance().GetCaptionData(
		 CloseCaptionPropEnums.EAnalogCC);
		 int digitalcc = mTvFramework.getCaptionInstance().GetCaptionData(
		 CloseCaptionPropEnums.EDigitalCC);
		 if (analogcc == CCAnalogDigitalServiceType.OFF.ordinal()
		 || analogcc > CCAnalogDigitalServiceType.TXT4.ordinal()) {
		 setAnalogCC(CCAnalogDigitalServiceType.CC1.ordinal());
		 }
		 if (digitalcc == CCAnalogDigitalServiceType.OFF.ordinal()
		 || (digitalcc >= CCAnalogDigitalServiceType.TXT1.ordinal()
		 && digitalcc <= CCAnalogDigitalServiceType.TXT4.ordinal())) {
		 setDigitalCC(CCAnalogDigitalServiceType.CS1.ordinal());
		 }
		 if (closedCaptions ==
		 CCDisplayMode.CC_DISPLAY_ON_WHEN_MUTE.ordinal()) {
		 AudioManager mAudioManager = (AudioManager)
		 mContext.getSystemService(Context.AUDIO_SERVICE);
		 mAudioManager.isStreamMute(AudioManager.STREAM_MUSIC);
		 boolean mute = HisUtils.isSystemMute(mContext);
		 Log.d(TAG, "mAudioManager.isStreamMute() = "+ mute);
		 UpdateCCStatusByMute(mute);
		 }
		 } */
	}
	//in v4 add by libaocheng
	public boolean getCCStatus() {
        /* int cc = getClosedCaptions();
        boolean ccOn = false;
        if (cc == CCDisplayMode.CC_DISPLAY_ON.ordinal())
            ccOn = true;
        else if (cc == CCDisplayMode.CC_DISPLAY_ON_WHEN_MUTE.ordinal()) {
            boolean mute = HisUtils.isSystemMute(mContext);
            ccOn = mute;
        }
        return ccOn; */
		return false;
    }
	public synchronized void UpdateCCStatusByMute(boolean bMute) {
        /* Log.i(TAG, "UpdateCCMuteStatus mute =" + bMute);
        Caption cc = TvFramework.getInstance().getCaptionInstance();
        if ((cc != null) && (cc.getCCMode() == CCDisplayMode.CC_DISPLAY_ON_WHEN_MUTE)) {
            cc.setCCStatus(bMute);
		 } */
	}

	public int getAnalogCC_old() {
		 /* int analogcc = mTvFramework.getCaptionInstance().GetCaptionData(
		 CloseCaptionPropEnums.EAnalogCC);
		return analogcc; */
		return 0;
	}

    public int getAnalogCC() {
        /* int analogcc = mTvFramework.getCaptionInstance().GetCaptionData(
                CloseCaptionPropEnums.EAnalogCC);
        return analogcc; */
		return 0;
    }

	public int getDigitalCC() {
		/* int digitalcc = mTvFramework.getCaptionInstance().GetCaptionData(
                CloseCaptionPropEnums.EDigitalCC);
        return digitalcc; */
		return 0;
	}

	public void setAnalogCC(int analogCC) {
        /* boolean ccOn = getCCStatus();
		// Log.d(TAG, "------- setAnalogCC---getCCon= " + ccOn);
        if (ccOn) {
            mTvFramework.getCaptionInstance().setCCStatus(false);
        }
		// Log.d(TAG, "------- setAnalogCC---analogCC= " + analogCC);
        mTvFramework.getCaptionInstance().SetCaptionData(CloseCaptionPropEnums.EAnalogCC,
                analogCC);
		// int value=getAnalogCC();
		// Log.d(TAG, "------setAnalogCC-- value---= " + value);
		//
        if (ccOn) {
            mTvFramework.getCaptionInstance().setCCStatus(true);
        } */
	}

	public int getDigitalCC_old() {
		 /* int digitalcc = mTvFramework.getCaptionInstance().GetCaptionData(
		 CloseCaptionPropEnums.EDigitalCC);
        return digitalcc; */
		return 0;
	}

    public void setDigitalCC(int digitalCC) {
        /* boolean ccOn = getCCStatus();
        if (ccOn) {
            mTvFramework.getCaptionInstance().setCCStatus(false);
        }
        mTvFramework.getCaptionInstance().SetCaptionData(CloseCaptionPropEnums.EDigitalCC,
                digitalCC);
        if (ccOn) {
            mTvFramework.getCaptionInstance().setCCStatus(true);
        } */
    }

    public void reSetClosedCaption() {
        //mTvFramework.getCaptionInstance().resetCaptionSettings();
        //mTvFramework.getCaptionInstance().getCaption(); // reload CC settings
    }

	/******************************* closedcaption end *********************************/

    /******************************* digital caption settings begin ***********************/
    /*private void setCaptionStyle(CloseCaptionPropEnums prop, int val) {
         boolean ccOn = getCCStatus();
        if (ccOn) {
            mTvFramework.getCaptionInstance().setCCStatus(false);
        }
        mTvFramework.getCaptionInstance().SetCaptionData(prop, val);
        if (ccOn) {
            mTvFramework.getCaptionInstance().setCCStatus(true);
        } 
    }*/

    public int getTextStyle() {
       /*  return mTvFramework.getCaptionInstance()
                .GetCaptionData(CloseCaptionPropEnums.EFontStyle); */
				return 0;
    }

    public void setTextStyle(int textStyle) {
        //setCaptionStyle(CloseCaptionPropEnums.EFontStyle, textStyle);
    }

    public int getTextSize() {
        //return mTvFramework.getCaptionInstance().GetCaptionData(CloseCaptionPropEnums.EFontSize);
		return 0;
    }

    public void setTextSize(int textSize) {
        //setCaptionStyle(CloseCaptionPropEnums.EFontSize, textSize);
    }

    public int getTextColor() {
        /* return mTvFramework.getCaptionInstance().GetCaptionData(
                CloseCaptionPropEnums.EFgFontColor); */
				return 0;
    }

    public void setTextColor(int textColor) {
        //setCaptionStyle(CloseCaptionPropEnums.EFgFontColor, textColor);
    }

    public int getTextOpacity() {
        /* return mTvFramework.getCaptionInstance()
                .GetCaptionData(CloseCaptionPropEnums.EFgFontOpacity); */
				return 0;
    }

    public void setTextOpacity(int textOpacity) {
        //setCaptionStyle(CloseCaptionPropEnums.EFgFontOpacity, textOpacity);
    }

    public int getTextEdgeColor() {
        /* return mTvFramework.getCaptionInstance()
                .GetCaptionData(CloseCaptionPropEnums.EFontEdgeColor); */
				return 0;
    }

    public void setTextEdgeColor(int textEdgeColor) {
        //setCaptionStyle(CloseCaptionPropEnums.EFontEdgeColor, textEdgeColor);
    }

    public int getTextEdgeType() {
        /* return mTvFramework.getCaptionInstance()
                .GetCaptionData(CloseCaptionPropEnums.EFontEdgeType); */
				return 0;
    }

    public void setTextEdgeType(int textEdgeType) {
        //setCaptionStyle(CloseCaptionPropEnums.EFontEdgeType, textEdgeType);
    }

    public int getBackgroundColor() {
        /* return mTvFramework.getCaptionInstance().GetCaptionData(
                CloseCaptionPropEnums.EBgFontColor);*/
				return 0;
    } 

    public void setBackgroundColor(int backgroundColor) {
        //setCaptionStyle(CloseCaptionPropEnums.EBgFontColor, backgroundColor);
    }

	public int getBackgroundOpacity() {
        /* return mTvFramework.getCaptionInstance()
                .GetCaptionData(CloseCaptionPropEnums.EBgFontOpacity); */
				return 0;
    }

	public void setBackgroundOpacity(int backgroundOpacity) {
        //setCaptionStyle(CloseCaptionPropEnums.EBgFontOpacity, backgroundOpacity);
	}

    public int getWindowColor() {
        //return mTvFramework.getCaptionInstance().GetCaptionData(CloseCaptionPropEnums.EWinColor);
		return 0;
    }

    public void setWindowColor(int windowColor) {
        //setCaptionStyle(CloseCaptionPropEnums.EWinColor, windowColor);
    }

    public int getWindowOpacity() {
        /* return mTvFramework.getCaptionInstance().GetCaptionData(
                CloseCaptionPropEnums.EWinOpacity); */
				return 0;
    }

    public void setWindowOpacity(int windowOpacity) {
        //setCaptionStyle(CloseCaptionPropEnums.EWinOpacity, windowOpacity);
    }

    public int getWindowEdgeColor() {
        /* return mTvFramework.getCaptionInstance()
                .GetCaptionData(CloseCaptionPropEnums.EWinEdgeColor); */
				return 0;
    }

    public void setWindowEdgeColor(int windowEdgeColor) {
        //setCaptionStyle(CloseCaptionPropEnums.EWinEdgeColor, windowEdgeColor);
    }

    public int getWindowEdgeType() {
        /* return mTvFramework.getCaptionInstance()
                .GetCaptionData(CloseCaptionPropEnums.EWinEdgeType); */
				return 0;
    }

    public void setWindowEdgeType(int windowEdgeType) {
        //setCaptionStyle(CloseCaptionPropEnums.EWinEdgeType, windowEdgeType);
    }

	/******************************* digital caption settings end *********************************/

	/******************************* Parental Controls begin *********************************/
	private int pcEnable = 0;

	public int getPCEnable() {
        /* USDTVPCData pcData = mTvFramework.getParentalControlInstance()
                .getParentalSettings();
        if (pcData != null)
            return pcData.isPcEnable() ? 1 : 0;
        else*/
            return pcEnable; 
    }

    public void setPCEnable(int value) {
        /* USDTVPCData pcData = mTvFramework.getParentalControlInstance()
                .getParentalSettings();
        if (pcData != null) {
            pcData.setPcEnable(value == 1);
            pcData.setPresetMode(PCPresetModes.PRESET_CUSTOM.ordinal());
            // only custom preset can be modified
            mTvFramework.getParentalControlInstance().setParentalSettings(pcData);
            mTvFramework.getParentalControlInstance().enableNonRfParentalControl(value==1);
        } else {
            pcEnable = value;
        } */
    }

	private int pcRatingEnable = 0;

	public int getPCRatingEnable() {
        /* USDTVPCData pcData = mTvFramework.getParentalControlInstance()
                .getParentalSettings();
        if (pcData != null)
            return pcData.isPcRatingEnable() ? 1 : 0;
        else */
            return pcRatingEnable;
    }

    public void setPCRatingEnable(int value) {
        /* USDTVPCData pcData = mTvFramework.getParentalControlInstance()
                .getParentalSettings();
        if (pcData != null) {
            pcData.setPcRatingEnable(value == 1);
            mTvFramework.getParentalControlInstance().setParentalSettings(pcData);
        } else {
            pcRatingEnable = value;
        } */
    }

    public int getUSAMovie() {
        /* USDTVUSRating usRating = mTvFramework.getParentalControlInstance()
                .getUSParentalRating();
        if (usRating != null) {
            return usRating.getMpaaRating();
        } else {
            return PCUSMovieRatings.MPAA_NR.ordinal();
        } */
		return 0;
    }

	public void setUSAMovie(int value) {
		// unblock lower rating level firstly
        /* if (value - 1 >= PCUSMovieRatings.MPAA_G.ordinal()) {
            mTvFramework.getParentalControlInstance().setUSParentalRating(
                    PCDimensionRating.US_MPAA, value - 1, false);
        }
        mTvFramework.getParentalControlInstance().setUSParentalRating(
                PCDimensionRating.US_MPAA, value, true); */
		// Log.d("setUSMovieRating", "====setUSAMovie_new=-----value= "+value);
	}

    public int getCANEnglish() {
        /* USDTVCanRating canRating = mTvFramework.getParentalControlInstance()
                .getCanadaParentalRating();
        if (canRating != null) {
            return canRating.getEngRating();
        } else {
            return PCCanadaEnglishRatings.ENG_18.ordinal() + 1; // NR
        } */
		return 0;
    }

    public void setCANEnglish(int value) {
        // unblock lower rating level firstly
        /* if (value - 1 >= PCCanadaEnglishRatings.ENG_CHILD.ordinal()) {
            mTvFramework.getParentalControlInstance().setCanadaParentalRating(
                    PCDimensionRating.CAN_ENG, value - 1, false);
        }
        mTvFramework.getParentalControlInstance().setCanadaParentalRating(
                PCDimensionRating.CAN_ENG, value, true); */
    }

    public int getCANFrench() {
        /* USDTVCanRating canRating = mTvFramework.getParentalControlInstance()
                .getCanadaParentalRating();
        if (canRating != null) {
            return canRating.getFrenchRating();
        } else {
            return PCCanadaFrenchRating.FRA_18.ordinal() + 1; // NR
        } */
		return 0;
    }

    public void setCANFrench(int value) {
        // unblock lower rating level firstly
        /* if (value - 1 >= PCCanadaFrenchRating.FRA_ALL.ordinal()) {
            mTvFramework.getParentalControlInstance().setCanadaParentalRating(
                    PCDimensionRating.CAN_FRA, value - 1, false);
        }
        mTvFramework.getParentalControlInstance().setCanadaParentalRating(
                PCDimensionRating.CAN_FRA, value, true); */
    }

    public int getBlockUnratedShows() {
        /* return mTvFramework.getParentalControlInstance().getRatingUnratedGroups(
                PCUSUnratedGroups.GROUP_UR_NA); */
				return 0;
    }

    public void setBlockUnratedShows(int value) {
        /* mTvFramework.getParentalControlInstance().setRatingUnratedGroups(value == 1,
                PCUSUnratedGroups.GROUP_UR_NA); */
    }

	/******************************* Parental Controls end *********************************/

	/******************************* systeminfo begin *********************************/
	public String getVersion() {
		// return Utils.SystemInfo.getString(Utils.SystemInfo.VERSION);
		return null;
	}

	public String getModuleNumber() {
		// return Utils.SystemInfo.getString(Utils.SystemInfo.MODULE_NUMBER);
		return null;
	}

	public String getBuildTime() {
		// return Utils.SystemInfo.getString(Utils.SystemInfo.BUILD_TIME);
		return null;
	}

	public String getGoogleLegal() {
		return "";
	}

	public String getOpenSourceLiscense() {
		return "";
	}

	public int getEdgeColor() {
		// EdgeColor = USDTVFramework.getInstance().getCCSettingsInstance()
		// .getCCSettings().getUSDTVSetCaptionStyleSettings().getFontEdgeColor();
		// return EdgeColor;
		return 0;
	}

	public void setEdgeColor(int edgeColor) {
		// EdgeColor = edgeColor;
		// USDTVFramework.getInstance().getCCSettingsInstance()
		// .getCCSettings().getUSDTVSetCaptionStyleSettings().setFontEdgeColor(EdgeColor);
	}

	public int getEdgeType() {
		// EdgeType = USDTVFramework.getInstance().getCCSettingsInstance()
		// .getCCSettings().getUSDTVSetCaptionStyleSettings().getFontEdgeType();
		// return EdgeType;
		return 0;
	}

	public void setEdgeType(int edgeType) {
		// EdgeType = edgeType;
		// USDTVFramework.getInstance().getCCSettingsInstance()
		// .getCCSettings().getUSDTVSetCaptionStyleSettings().setFontEdgeType(EdgeType);

	}

	public int getTextMode() {
		// TextMode = USDTVFramework.getInstance().getCCSettingsInstance()
		// .getCCSettings().getUSDTVSetCaptionService().getDigCCStyle();
		// return TextMode;
		return 0;
	}

	public void setTextMode(int textMode) {
		// TextMode = textMode;
		// USDTVFramework.getInstance().getCCSettingsInstance()
		// .getCCSettings().getUSDTVSetCaptionService().setDigCCStyle(textMode);
	}

	/******************************* Hdmi Cec Setting start *************************/
	
	public int getHdmiCec() {
		int enabled = 0;
        /* Log.d(TAG, "getHdmiCec mCecManager=" + mCecManager);
        if (mCecManager != null) {
            enabled = mCecManager.isCECEnabled() == true ? 1 : 0;
        }
        Log.d(TAG, "getHdmiCec enabled=" + enabled); */
        return enabled;
    }

    public void setHdmiCec(int state) {
        /* if (mCecManager != null) {
            if (state == 1) {
                Log.d(TAG, "setHdmiCec call enableCEC");
                mCecManager.enableCEC();
            } else {
                Log.d(TAG, "setHdmiCec call disableCEC");
                mCecManager.disableCEC();
            }
        } */
    }

    public int getDeviceAutoPowerOff() {
        /* int enabled = 0;
        if (mCecManager != null) {
            enabled = mCecManager.isDeviceAutoPowerOffEnabled() == true ? 1 : 0;
        }
        else {
            Log.d(TAG, "getDeviceAutoPowerOff mCecPrefs is null.");
        }
        Log.d(TAG, "getDeviceAutoPowerOff enabled=" + enabled);
        return enabled; */
		return 0;
    }

    public void setDeviceAutoPowerOff(int state) {
        /* if (mCecManager != null) {
            if (state == 1) {
                Log.d(TAG, "setDeviceAutoPowerOff enableDeviceAutoPowerOff");
                mCecManager.enableDeviceAutoPowerOff();
            } else if (state == 0) {
                Log.d(TAG, "setDeviceAutoPowerOff disableDeviceAutoPowerOff");
                mCecManager.disableDeviceAutoPowerOff();
            }
        } */
    }

    public int getTvAutoPowerOn() {
        int enabled = 0;
        /* if (mCecManager != null) {
            enabled = mCecManager.isTVAutoPowerOnEnabled() == true ? 1 : 0;
        }
        Log.d(TAG, "getTvAutoPowerOn enabled=" + enabled); */
        return enabled;
    }

    public void setTvAutoPowerOn(int state) {
        /* if (mCecManager != null) {
            if (state == 1) {
                Log.d(TAG, "setTvAutoPowerOn call enableTVAutoPowerOn");
                mCecManager.enableTVAutoPowerOn();
            } else {
                Log.d(TAG, "setTvAutoPowerOn call disableTVAutoPowerOn");
                mCecManager.disableTVAutoPowerOn();
            }
        } */
    }

    public int getSystemAudioControl() {
        int enabled = 0;
       /*  if (mCecManager != null) {
            Log.d(TAG, "getSystemAudioControl call isSACEnabled");
            enabled = ((mCecManager.isSystemAudioModeEnabled() == true ? 1 : 0));
        } */
        return enabled;
    }

    public void setSystemAudioControl(int state) {
        /* if ((mCecManager != null)) {
            if (state == 1) {
                Log.d(TAG, "setSystemAudioControl call enableSystemAudioMode");
                mCecManager.enableSystemAudioMode();
            } else {
                Log.d(TAG, "setSystemAudioControl call disableSystemAudioMode");
                mCecManager.disableSystemAudioMode();
            }
        } */
	}

	public int getCurrentHdmiInputPort() {
		int port = 0;
		/*  int curSrcType = getCurrentSource();
		 if(curSrcType == InputSourceType.HDMI1_INPUT.ordinal()) {
		 port = 1;
		 } else if (curSrcType == InputSourceType.HDMI2_INPUT.ordinal()) {
		 port = 2;
		 } else if (curSrcType == InputSourceType.HDMI3_INPUT.ordinal()) {
		 port = 3;
		 } else if (curSrcType == InputSourceType.HDMI4_INPUT.ordinal()) {
		 port = 4;
		 } */
		return port;
	}

	/******************************* Hdmi Cec Setting end ***************************/
	private int SleepTimer;

	public int getSleepTimer() {
		return SleepTimer;
	}

	public void setSleepTimer(int sleepTimer) {
		SleepTimer = sleepTimer;
		HisUtils.startSleepTimer(mContext, sleepTimer * HisUtils.ONE_MINUTE);
	}

	private int wakeupTimer = 0;

	public int getWakeupTimer() {
		return wakeupTimer;
	}

	public void setWakeupTimer(int value) {
		wakeupTimer = value;
		/* if (value == 0) {
			mTvFramework.getSystemInstance().setSysPowerOnOffTimer(
					PowerOnOffTimer.STOP_POWERON_TIMER, 0);
		} else {
			mTvFramework.getSystemInstance().setSysPowerOnOffTimer(
					PowerOnOffTimer.START_POWERON_TIMER, value * 60);
		} */
	}

	public int getMenuLanguage() {
		/* final Locale currentLocale = mContext.getResources().getConfiguration().locale;
		int index = Arrays.asList(
				mContext.getResources().getStringArray(R.array.language_code))
				.indexOf(currentLocale.getLanguage());
		return index == -1 ? 0 : index; */
		return 0;
	}

	public void setMenuLanguage(final int menuLanguage) {
		/* if (mThread == null) {
			mThread = new Thread(new Runnable() {

				@Override
				public void run() {
				}
			});
		} else {
			mThread.interrupt();
		}
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		mThread.start(); */

	}

	public void resetUser() {
		// FactorySettingJNIWrapper.getInstance().DoResetUser(RESET_PARAM.MASTER_CLEAR.ordinal());
	}

	private int TextSize;
	private int TextColor;
	private int TextOpacity;
	private int BackgroundColor;
	private int BackgroundOpacity;
	private int WindowColor;
	private int WindowOpacity;
	private int MenuLanguage;
	private int EdgeType;
	private int EdgeColor;
	private int TextMode;

    /************************** 3D begin ***********************************/
    public int getLRSwap() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode3DLRSwap); */
				return 0;
    }

    public void setLRSwap(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode3DLRSwap,
                value); */
    }

    public int getInput3Dto2D() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode3Dto2D); */
				return 0;
    }

    public void setInput3Dto2D(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode3Dto2D,
                value); */
    }

    public int getInput2Dto3D() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode2Dto3D); */
				return 0;
    }

    public void setInput2Dto3D(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode2Dto3D,
                value); */
    }

    public int getInput2Dto3DDepth() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode2Dto3DDepth); */
				return 0;
    }

    public void setInput2Dto3DDepth(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode2Dto3DDepth,
                value); */
    }

    public int getInput2Dto3DAngle() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode2Dto3DAngle); */
				return 0;
    }

    public void setInput2Dto3DAngle(int value) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode2Dto3DAngle,
                value); */
    }

    public int getInput3D() {
        /* return mTvFramework.getPictureInstance().getVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode3D); */
				return 0;
    }

    public void setInput3D(int input3d) {
        /* mTvFramework.getPictureInstance().setVideoProperty(getCurrentSource(),
                TvPictureProperty.TV_PICTURE_Mode3D,
                input3d); */
    }

	/************************** 3D end ***********************************/

	/************************** Others ***********************************/

    public boolean allowRatingOrCaption() {
        boolean ret = false;
        /* int srcType = getCurrentSourceType();
        if (srcType == TvSourceType.TV_SOURCE_TypeAtv.value()
                || srcType == TvSourceType.TV_SOURCE_TypeDtv.value()
                || srcType == TvSourceType.TV_SOURCE_TypeCvbs.value()) {
            ret = true;
        } else if (srcType == TvSourceType.TV_SOURCE_TypeComponent.value()) {
            // for Component input, only SD(480i) is supported Rating or CC 
            VideoInfoUpdate videoInfo = TvFramework.getInstance().getVideoInfo(
                    HisUtils.getTvRemoteService());
            if (videoInfo != null && videoInfo.getActiveHeight() <= 480
                    && videoInfo.getIsInterlaced() == 1) {
                ret = true;
            }
        } */
        return ret;
    }
	public boolean isDigitalChannel() {
		/* if (getCurrentSource() == TvSource.TV_SourceDtv.value()) {
			LiveTv liveTv = TvFramework.getInstance().getLiveTvInstance();
			USDTVServiceData currentChannel = liveTv.getCurrentService();
			if (currentChannel != null
                    && currentChannel.getServiceType() ==
                    ChannelType.DIGITAL_TELEVISION.ordinal()) {
                return true;
            }
        } */
        return false;
    }

	public boolean isTunerInput() {
		/* int currSrc = getCurrentSource();
		if (currSrc == TvSource.TV_SourceAtv.value()
				|| currSrc == TvSource.TV_SourceDtv.value()) {
			return true;
		} else {
			return false;
		} */
		return true;
	}

    public boolean isAnalogVideoInput() {
        /* int srcType = getCurrentSourceType();
        if (srcType == TvSourceType.TV_SOURCE_TypeComponent.value()
                || srcType == TvSourceType.TV_SOURCE_TypeCvbs.value()
                || srcType == TvSourceType.TV_SOURCE_TypeHdmi.value()
                || srcType == TvSourceType.TV_SOURCE_TypeVga.value()) {
            return true;
        } else {
            return false;
        } */
		return false;
    }

    public boolean isStreamInput() {
        /* int srcType = getCurrentSourceType();
        if (srcType == TvSourceType.TV_SOURCE_TypeStream.value()) {
            return true;
        } else {
            return false;
        } */
		return false;
    }

    /********************************* Multi-thread begin ************************************/

	/**
	 * Run a runnable in non UI thread
	 * 
	 * @param runnable
	 * @param delay
	 *            time in msec, no delay if 0
	 */
	/* public void runInNonUiThread(Runnable runnable, int delay) {
		Handler handler = USDTVMessageQueue.getMsgQueueHandler();
		handler.removeCallbacks(runnable);
		if (delay != 0)
			handler.postDelayed(runnable, delay);
		else
			handler.post(runnable);
	} */

	/********************************* Multi-thread end ************************************/
	public boolean isEASEnabled() {
        // @todo
        return false;
    }
}
